package com.yunxin.core.infra.persistence.converter;

import com.yunxin.core.domain.model.page.Page;
import com.yunxin.core.domain.model.page.PageCache;
import com.yunxin.core.domain.model.page.PagePopupUserRecord;
import com.yunxin.core.infra.persistence.entity.page.PageCacheDO;
import com.yunxin.core.infra.persistence.entity.page.PageDO;
import com.yunxin.core.infra.persistence.entity.page.PagePopupUserRecordDO;
import org.mapstruct.Mapper;

/**
 * @author zero°
 * @since 2023-07-12
 */
@Mapper(componentModel = "spring")
public interface PageConverter {

    /**
     * do 转 entity
     *
     * @param pageDO pageDO
     * @return Page
     */
    Page toPage(PageDO pageDO);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return PagePopupUserRecordDO
     */
    PagePopupUserRecordDO fromPagePopupUserRecord(PagePopupUserRecord entity);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return PageCacheDO
     */
    PageCacheDO fromPageCache(PageCache entity);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return PageDO
     */
    PageDO formPage(Page entity);




}
